package com.midian.model.permission;

import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import com.midian.model.common.BaseModel;

/**
 * 角色权限中间实体
 * @author Mengfh
 *
 */
@Entity
@Table(name = "role_auth")
public class RoleAuth extends BaseModel {
	
	private static final long serialVersionUID = -581019930196450345L;
	/**角色对象*/
	@ManyToOne(optional = true, fetch = FetchType.LAZY)
	@JoinColumn(name = "roleId")
	private Role role;
	/**权限细项对象*/
	@ManyToOne(optional = true, fetch = FetchType.LAZY)
	@JoinColumn(name = "authId")
	private Auth auth;

	public Role getRole() {
		return role;
	}

	public void setRole(Role role) {
		this.role = role;
	}

	public Auth getAuth() {
		return auth;
	}

	public void setAuth(Auth auth) {
		this.auth = auth;
	}
}
